#!/bin/sh
# preinst script
#
# see: dh_installdeb(1)

#set -e

PATH=/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
export PATH

if [ "${BASEDIR:=/}" = "/" ]; then
    BASEDIR=""
fi

case "$1" in
    install|upgrade)
	if [ ! -L $BASEDIR/usr/sbin/audlinks ]; then
	rm -f $BASEDIR/usr/sbin/audlinks
	rm -f $BASEDIR/usr/sbin/devlinks
	rm -f $BASEDIR/usr/sbin/disks
	rm -f $BASEDIR/usr/sbin/drvconfig
	rm -f $BASEDIR/usr/sbin/ports
	rm -f $BASEDIR/usr/sbin/tapes
	fi
    ;;

    abort-upgrade)
    ;;

    *)
        echo "preinst called with unknown argument '$1'" >&2
        exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

exit 0
